home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample PMSAM / PMSAM Framework / Common / Debug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  1.0 KB  |  44 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Debug.h
  3.  
  4.     Contains:    Assert/Debug stuff ripped of from the Finder.
  5.  
  6.     Written by:    Tim Harnett
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>     10/6/94    TMH        added ASSERTNOERR
  13.          <1>     9/21/94    TMH        new, gotta have this stuff
  14.                  9/21/94    TMH        xxx put comment here xxx
  15.  
  16.     To Do:
  17. */
  18.  
  19. #ifndef __Debug__
  20. #define __Debug__
  21.  
  22. #ifndef __TYPES__
  23. #include "Types.h"
  24. #endif
  25.  
  26. extern void dbgAssert(const char* filename, int line);
  27. extern void dbgAssertPrint(const char*, ...);
  28. void dbgAssertNoErr(const char* filename, int line,OSErr osErr);
  29.  
  30.  
  31. #define BLOCKASSERT(what)                { if (!(what)) dbgAssert(__FILE__,__LINE__); }
  32. #define    ASSERT(what)                    do BLOCKASSERT(what) while(0)
  33.  
  34.  
  35. #define BLOCKASSERTPRINT(what, args)    { if (!(what)) { dbgAssertPrint args; } }
  36. #define ASSERTPRINT(what, args)            do BLOCKASSERTPRINT(what, args) while (0)
  37.  
  38.  
  39. #define BLOCKASSERTNOERR(what)        { if ((what)!=noErr) { dbgAssertNoErr(__FILE__,__LINE__,what); } }
  40. #define ASSERTNOERR(what)            do BLOCKASSERTNOERR(what) while (0)
  41.  
  42.  
  43. #endif __Debug__
  44.